import React, { Component } from 'react'
import { withRouter } from 'react-router-dom'

 class WaitItem extends Component {
  goDes=(el)=>{
    this.props.history.push(`/moviedes/${el.id}/${el.nm}`)
    this.props.recordDes(el)
  }
  render() {
    let { waitlist } = this.props
    return (
      <>
        <ul>
          {
            waitlist.map(el => {
              return (
                <li key={el.id} onClick={()=>this.goDes(el)}>
                  <div className="tu">
                    <img src={el.img} alt="" />
                    <p className="mzi2">{el.wish}人想看</p>
                  </div>
                  <p className="mzi">{el.nm}</p>
                  <p style={{'fontSize':'12px','color':'gray'}}>{el.comingTitle}</p>
                </li>
              )
            })
          }
        </ul>
      </>
    )
  }
}
export default withRouter(WaitItem)